package com.example.springai.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * 聊天记录实体类
 */

@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_history")

public class History implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(title = "聊天时间")
    @TableField("datetime")

    @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime datetime;
    @Schema(title = "聊天内容")
    @TableField("content")

    private String content;
    @Schema(title = "角色")
    @TableField("role")

    private String role;
    @Schema(title = "会话Id")
    @TableField("sessionId")

    private Long sessionId;
}
